//
//  NetWorkTask.m
//  UI16_PackageNetWorkr
//
//  Created by dllo on 15/11/16.
//  Copyright (c) 2015年 YXY. All rights reserved.
//

#import "NetWorkTask.h"

@implementation NetWorkTask

+(void)sendRequestWithGet:(NSURL *)url withResult:(void (^)(id))block {
    
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
        id result = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
        block(result);
    }];
    
}




@end
